/**
 * 折线图和累积图
 */

import React from 'react';
import { findDOMNode } from 'react-dom';
import LineAreaChart from './LineAreaChart';
import merge from 'lodash/object/merge';
import isEqual from 'lodash/lang/isEqual'
import Highcharts from 'Highcharts';

export default class ExamFlowLineAreaChart extends LineAreaChart {
	
	/**
	 * @override
	 */
	getSeries(props) {
		let { dataSource, hasEntry } = props;
		let series = [];

		if (hasEntry) {
			series.push({
				name: '入口页',
				type: 'area',
				data: [].concat(dataSource.entrySeries),
				tooltip: {
					valueSuffix: ''
				}
			});
		}

		series = series.concat([{
			name: '详情页',
			type: 'area',
			data: [].concat(dataSource.detailSeries),
			tooltip: {
				valueSuffix: ''
			}
		}, {
			name: '用题人次',
			type: 'area',
			data: [].concat(dataSource.questionSeries),
			tooltip: {
				valueSuffix: ''
			}
		}, {
			name: '入口转化',
			type: 'line',
			yAxis: 1,
			data: [].concat(dataSource.entryConversionSeries),
			tooltip: {
				valueSuffix: '%'
			}
		}, {
			name: '用题转化',
			type: 'line',
			yAxis: 1,
			data: [].concat(dataSource.questionConversionSeries),
			tooltip: {
				valueSuffix: '%'
			}
		}]);

		return series;
	}
}